Scrap your boilerplate: a practical design pattern for generic programming